def insertion_sort(lst):
    for i in range(1, len(lst)):
        key = lst[i]
        j = i - 1
        while j >= 0 and key < lst[j]:
            lst[j + 1] = lst[j]
            j -= 1
        lst[j + 1] = key
    return lst


# print(list(range()))
if __name__ == '__main__':
    l1 = [1, 100, 23, 9, 10, 200, 1000, -1, 500, 666]
    print(insertion_sort(l1))